import wx

class DiaFinder(wx.Dialog):
    def __init__(self, parent, title, *args, **kwargs):
        super().__init__(parent, -1, title)

        self.Data = kwargs.get('data')
        self.Page = kwargs.get('grid')

        self.LastLocation = None
        self.LastPage = None
        self.IsCheckUp = False
        self.IsCheckAll = False

        MainSizer = wx.BoxSizer(wx.VERTICAL)
        FriSizer = wx.BoxSizer(wx.HORIZONTAL)
        SecSizer = wx.BoxSizer(wx.HORIZONTAL)

        SearchText = wx.StaticText(self, -1, label=' 查找内容：')
        UpText = wx.Button(self, -1, label='↑', size=(40, -1))
        DownText = wx.Button(self, -1, label='↓', size=(40, -1))
        Entry = wx.TextCtrl(self, -1, size=(400, -1))

        CheckUp = wx.CheckBox(self, -1, '区分大小写')
        CheckAll = wx.CheckBox(self, -1, '全字匹配')

        MainSizer.Add(FriSizer)
        MainSizer.Add(SecSizer, 0, wx.CENTRE)

        FriSizer.Add(SearchText, 0, wx.ALL|wx.CENTRE, 5)
        FriSizer.Add(Entry, 0, wx.ALL|wx.CENTRE, 5)
        FriSizer.Add(UpText, 0, wx.ALL|wx.CENTRE, 5)
        FriSizer.Add(DownText, 0, wx.ALL|wx.CENTRE, 5)

        SecSizer.Add(CheckUp, 0, wx.ALL|wx.CENTRE|wx.EXPAND, 5)
        SecSizer.Add(CheckAll, 0, wx.ALL|wx.CENTRE|wx.EXPAND, 5)

        self.SetSizer(MainSizer)
        MainSizer.Fit(self)
        MainSizer.SetSizeHints(self)

        self.Bind(wx.EVT_CHECKBOX, self.OnCheckUp, CheckUp)
        self.Bind(wx.EVT_CHECKBOX, self.OnCheckAll, CheckAll)

    def OnUp(self, event):
        pass

    def OnDown(self, event):
        pass

    def OnCheckUp(self, event):
        self.IsCheckUp = not self.IsCheckUp

    def OnCheckAll(self, event):
        self.IsCheckAll = not self.IsCheckAll

if __name__ == "__main__":
    import os
    class MyFrame(wx.Frame):
        def __init__(self):
            super().__init__(None, -1, 'haha', size=(200, 100))
            btn = wx.Button(self, -1, 'baba', size=(10, 10))
            self.Bind(wx.EVT_BUTTON, self.OnClick, btn)

        def OnClick(self, event):
            # modal = DiaTable2add(self, 'baba').ShowModal()
            dia = DiaFinder(self, 'haha')
            # data = wx.FindReplaceData()
            # dia = wx.FindReplaceDialog(self, data, 'haha')
            modal = dia.ShowModal()
            print(modal)
            dia.Destroy()

    app = wx.App()
    MyFrame().Show()
    app.MainLoop()